<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>CPP11ThreadPool: WorkStealingPoolExecutor类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="CPP.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">CPP11ThreadPool
   </div>
   <div id="projectbrief">C++11线程池</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="classWorkStealingPoolExecutor-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">WorkStealingPoolExecutor类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>任务窃取线程池,从下一个线程的任务队列窃取任务  
 <a href="classWorkStealingPoolExecutor.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="workstealingpoolexecutor_8hpp_source.html">workstealingpoolexecutor.hpp</a>&gt;</code></p>
<div class="dynheader">
类 WorkStealingPoolExecutor 继承关系图:</div>
<div class="dyncontent">
<div class="center"><img src="classWorkStealingPoolExecutor__inherit__graph.png" border="0" usemap="#WorkStealingPoolExecutor_inherit__map" alt="Inheritance graph"/></div>
<map name="WorkStealingPoolExecutor_inherit__map" id="WorkStealingPoolExecutor_inherit__map">
<area shape="rect" id="node2" href="classThreadPoolExecutor.html" title="线程池基本实现,每个线程都有一个任务队列 " alt="" coords="25,5,165,32"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">图例</a>]</span></center></div>
<div class="dynheader">
WorkStealingPoolExecutor 的协作图:</div>
<div class="dyncontent">
<div class="center"><img src="classWorkStealingPoolExecutor__coll__graph.png" border="0" usemap="#WorkStealingPoolExecutor_coll__map" alt="Collaboration graph"/></div>
<map name="WorkStealingPoolExecutor_coll__map" id="WorkStealingPoolExecutor_coll__map">
<area shape="rect" id="node2" href="classThreadPoolExecutor.html" title="线程池基本实现,每个线程都有一个任务队列 " alt="" coords="25,5,165,32"/>
</map>
<center><span class="legend">[<a href="graph_legend.html">图例</a>]</span></center></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a6f3b6c9f2b85bf2d16f47adc11373bd0"><td class="memItemLeft" align="right" valign="top"><a id="a6f3b6c9f2b85bf2d16f47adc11373bd0"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>WorkStealingPoolExecutor</b> (int32_t corePoolSize, int32_t maxPoolSize, const std::vector&lt; <a class="el" href="classBlockingQueue.html">BlockingQueue</a>&lt; Runnable::sptr &gt;&gt; &amp;workQueue, const <a class="el" href="classRejectedExecutionHandler.html">RejectedExecutionHandler</a> &amp;handler, const std::string &amp;prefix=&quot;&quot;)</td></tr>
<tr class="separator:a6f3b6c9f2b85bf2d16f47adc11373bd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af5a4263bc3a71629a9f87a950c64badb"><td class="memItemLeft" align="right" valign="top"><a id="af5a4263bc3a71629a9f87a950c64badb"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>WorkStealingPoolExecutor</b> (int32_t corePoolSize, int32_t maxPoolSize, const std::vector&lt; <a class="el" href="classBlockingQueue.html">BlockingQueue</a>&lt; Runnable::sptr &gt;&gt; &amp;workQueue, <a class="el" href="classRejectedExecutionHandler.html">RejectedExecutionHandler</a> *handler, const std::string &amp;prefix=&quot;&quot;)</td></tr>
<tr class="separator:af5a4263bc3a71629a9f87a950c64badb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0c1afe0d9ef06205dd01d5ced97c8981"><td class="memItemLeft" align="right" valign="top"><a id="a0c1afe0d9ef06205dd01d5ced97c8981"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>WorkStealingPoolExecutor</b> (int32_t corePoolSize, int32_t maxPoolSize, const std::string &amp;prefix=&quot;&quot;)</td></tr>
<tr class="separator:a0c1afe0d9ef06205dd01d5ced97c8981"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a84571339d5bafe81925c10d27f020ab4"><td class="memTemplParams" colspan="2">template&lt;typename F &gt; </td></tr>
<tr class="memitem:a84571339d5bafe81925c10d27f020ab4"><td class="memTemplItemLeft" align="right" valign="top">std::future&lt; typename std::result_of&lt; F()&gt;::type &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classWorkStealingPoolExecutor.html#a84571339d5bafe81925c10d27f020ab4">submit</a> (F f, bool core=true)</td></tr>
<tr class="memdesc:a84571339d5bafe81925c10d27f020ab4"><td class="mdescLeft">&#160;</td><td class="mdescRight">submit 在将来某个时候执行给定的任务, 任务可以在新线程或现有的合并的线程中执行, 可以有返回值,向任务队列提交的是任务副本 会抛出异常  <a href="#a84571339d5bafe81925c10d27f020ab4">更多...</a><br /></td></tr>
<tr class="separator:a84571339d5bafe81925c10d27f020ab4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad00399d153ba5d77704dae2c1816b566"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWorkStealingPoolExecutor.html#ad00399d153ba5d77704dae2c1816b566">workerThread</a> (size_t queueIdex) override</td></tr>
<tr class="memdesc:ad00399d153ba5d77704dae2c1816b566"><td class="mdescLeft">&#160;</td><td class="mdescRight">workerThread 核心工作线程  <a href="#ad00399d153ba5d77704dae2c1816b566">更多...</a><br /></td></tr>
<tr class="separator:ad00399d153ba5d77704dae2c1816b566"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae0445ee114ceec03cf9513c394df7c89"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classWorkStealingPoolExecutor.html#ae0445ee114ceec03cf9513c394df7c89">coreWorkerThread</a> (size_t queueIdex) override</td></tr>
<tr class="memdesc:ae0445ee114ceec03cf9513c394df7c89"><td class="mdescLeft">&#160;</td><td class="mdescRight">workerThread 非核心工作线程  <a href="#ae0445ee114ceec03cf9513c394df7c89">更多...</a><br /></td></tr>
<tr class="separator:ae0445ee114ceec03cf9513c394df7c89"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classThreadPoolExecutor"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classThreadPoolExecutor')"><img src="closed.png" alt="-"/>&#160;Public 成员函数 继承自 <a class="el" href="classThreadPoolExecutor.html">ThreadPoolExecutor</a></td></tr>
<tr class="memitem:a212b34b7e25e9eba4e096473a1b81f9e inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a212b34b7e25e9eba4e096473a1b81f9e">ThreadPoolExecutor</a> (int32_t corePoolSize, int32_t maxPoolSize, const std::vector&lt; <a class="el" href="classBlockingQueue.html">BlockingQueue</a>&lt; Runnable::sptr &gt;&gt; &amp;workQueue, const <a class="el" href="classRejectedExecutionHandler.html">RejectedExecutionHandler</a> &amp;handler, const std::string &amp;prefix=&quot;&quot;)</td></tr>
<tr class="memdesc:a212b34b7e25e9eba4e096473a1b81f9e inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classThreadPoolExecutor.html" title="线程池基本实现,每个线程都有一个任务队列 ">ThreadPoolExecutor</a> 构造函数,workQueue的大小要不大于corePoolSize 每个线程根据顺序将对应位置的BlockingQueue&lt;Runnable&gt; 作为自己的任务队列 会抛出异常  <a href="classThreadPoolExecutor.html#a212b34b7e25e9eba4e096473a1b81f9e">更多...</a><br /></td></tr>
<tr class="separator:a212b34b7e25e9eba4e096473a1b81f9e inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab750236e7b95489a1cb66d4b026717fc inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#ab750236e7b95489a1cb66d4b026717fc">ThreadPoolExecutor</a> (int32_t corePoolSize, int32_t maxPoolSize, const std::vector&lt; <a class="el" href="classBlockingQueue.html">BlockingQueue</a>&lt; Runnable::sptr &gt;&gt; &amp;workQueue, <a class="el" href="classRejectedExecutionHandler.html">RejectedExecutionHandler</a> *handler, const std::string &amp;prefix=&quot;&quot;)</td></tr>
<tr class="memdesc:ab750236e7b95489a1cb66d4b026717fc inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classThreadPoolExecutor.html" title="线程池基本实现,每个线程都有一个任务队列 ">ThreadPoolExecutor</a> 构造函数,workQueue的大小要不大于corePoolSize 每个线程根据顺序将对应位置的BlockingQueue&lt;Runnable&gt; 作为自己的任务队列 会抛出异常  <a href="classThreadPoolExecutor.html#ab750236e7b95489a1cb66d4b026717fc">更多...</a><br /></td></tr>
<tr class="separator:ab750236e7b95489a1cb66d4b026717fc inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a071bcc9eb42b365e2ce28a32938d422e inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a071bcc9eb42b365e2ce28a32938d422e">ThreadPoolExecutor</a> (int32_t corePoolSize, int32_t maxPoolSize, const std::string &amp;prefix=&quot;&quot;)</td></tr>
<tr class="memdesc:a071bcc9eb42b365e2ce28a32938d422e inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classThreadPoolExecutor.html" title="线程池基本实现,每个线程都有一个任务队列 ">ThreadPoolExecutor</a> 构造函数,根据corePoolSize构造相同大小的workQueue 每个线程根据顺序将对应位置的BlockingQueue&lt;Runnable&gt; 作为自己的任务队列 会抛出异常  <a href="classThreadPoolExecutor.html#a071bcc9eb42b365e2ce28a32938d422e">更多...</a><br /></td></tr>
<tr class="separator:a071bcc9eb42b365e2ce28a32938d422e inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d5a1c3330593f243959256d32068c15 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a1d5a1c3330593f243959256d32068c15"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a1d5a1c3330593f243959256d32068c15">~ThreadPoolExecutor</a> ()</td></tr>
<tr class="memdesc:a1d5a1c3330593f243959256d32068c15 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">~ThreadPoolExecutor 析构函数 <br /></td></tr>
<tr class="separator:a1d5a1c3330593f243959256d32068c15 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2aa11f7cde6e6082eb0dde8f2385dce inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#ac2aa11f7cde6e6082eb0dde8f2385dce">keepNonCoreThreadAlive</a> () const final</td></tr>
<tr class="memdesc:ac2aa11f7cde6e6082eb0dde8f2385dce inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">nonCoreThreadAlive 是否允许非核心线程超时,若允许则线程执行完 一个任务后不会退出,会继续存在  <a href="classThreadPoolExecutor.html#ac2aa11f7cde6e6082eb0dde8f2385dce">更多...</a><br /></td></tr>
<tr class="separator:ac2aa11f7cde6e6082eb0dde8f2385dce inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e6ed2d088147377d1e82018ac3dac1d inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a7e6ed2d088147377d1e82018ac3dac1d">keepNonCoreThreadAlive</a> (bool value) final</td></tr>
<tr class="memdesc:a7e6ed2d088147377d1e82018ac3dac1d inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">keepNonCoreThreadAlive 设置是否允许非核心thread超时并且在没有任务时终止  <a href="classThreadPoolExecutor.html#a7e6ed2d088147377d1e82018ac3dac1d">更多...</a><br /></td></tr>
<tr class="separator:a7e6ed2d088147377d1e82018ac3dac1d inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d4bfa422c41a11fcdd33e7a1b2bcec8 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a7d4bfa422c41a11fcdd33e7a1b2bcec8"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a7d4bfa422c41a11fcdd33e7a1b2bcec8">releaseWorkers</a> ()</td></tr>
<tr class="memdesc:a7d4bfa422c41a11fcdd33e7a1b2bcec8 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">releaseWorkers 释放所有线程(释放线程资源,并弹出线程队列) <br /></td></tr>
<tr class="separator:a7d4bfa422c41a11fcdd33e7a1b2bcec8 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe693b22533251b638317683a7e8fa96 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="abe693b22533251b638317683a7e8fa96"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#abe693b22533251b638317683a7e8fa96">releaseNonCoreThreads</a> ()</td></tr>
<tr class="memdesc:abe693b22533251b638317683a7e8fa96 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">releaseNonCoreThreads 释放非核心线程(释放线程资源,并弹出线程队列) 如果keepNonCoreThreadAlive=false, 那么非核心线程会自动退出 执行时会将keepNonCoreThreadAlive设为false, 释放所有非核心线程 <br /></td></tr>
<tr class="separator:abe693b22533251b638317683a7e8fa96 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0a471dc0a68b70d99d8215565a4df688 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a0a471dc0a68b70d99d8215565a4df688">setRejectedExecutionHandler</a> (<a class="el" href="classRejectedExecutionHandler.html">RejectedExecutionHandler</a> handler) final</td></tr>
<tr class="memdesc:a0a471dc0a68b70d99d8215565a4df688 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">setRejectedExecutionHandler 设置新的任务拒绝策略  <a href="classThreadPoolExecutor.html#a0a471dc0a68b70d99d8215565a4df688">更多...</a><br /></td></tr>
<tr class="separator:a0a471dc0a68b70d99d8215565a4df688 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4dac3c2435919af5d77aa36069d35bc7 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a4dac3c2435919af5d77aa36069d35bc7">execute</a> (Runnable::sptr command, bool core=true)</td></tr>
<tr class="memdesc:a4dac3c2435919af5d77aa36069d35bc7 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">execute 在将来某个时候执行给定的任务,无返回值, 任务可以在新线程或现有的合并的线程中执行, 向任务队列提交的是任务副本 不会抛出异常  <a href="classThreadPoolExecutor.html#a4dac3c2435919af5d77aa36069d35bc7">更多...</a><br /></td></tr>
<tr class="separator:a4dac3c2435919af5d77aa36069d35bc7 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a523df0545790ef03a82623b05e3b20f9 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a523df0545790ef03a82623b05e3b20f9">execute</a> (<a class="el" href="classRunnable.html">Runnable</a> &amp;command, bool core=true)</td></tr>
<tr class="memdesc:a523df0545790ef03a82623b05e3b20f9 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">execute 在将来某个时候执行给定的任务,无返回值, 任务可以在新线程或现有的合并的线程中执行, 向任务队列提交的是任务副本 不会抛出异常  <a href="classThreadPoolExecutor.html#a523df0545790ef03a82623b05e3b20f9">更多...</a><br /></td></tr>
<tr class="separator:a523df0545790ef03a82623b05e3b20f9 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a451bba3f90dbed2ba7e491ebc391b3c6 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a451bba3f90dbed2ba7e491ebc391b3c6">execute</a> (<a class="el" href="classBlockingQueue.html">BlockingQueue</a>&lt; Runnable::sptr &gt; &amp;commands, bool core=true)</td></tr>
<tr class="memdesc:a451bba3f90dbed2ba7e491ebc391b3c6 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">execute 在将来某个时候执行给定的任务,无返回值, 任务可以在新线程或现有的合并的线程中执行, 向任务队列提交的是任务副本 不会抛出异常  <a href="classThreadPoolExecutor.html#a451bba3f90dbed2ba7e491ebc391b3c6">更多...</a><br /></td></tr>
<tr class="separator:a451bba3f90dbed2ba7e491ebc391b3c6 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94834ab6bedcc75111524fec4e928b3f inherit pub_methods_classThreadPoolExecutor"><td class="memTemplParams" colspan="2">template&lt;typename F &gt; </td></tr>
<tr class="memitem:a94834ab6bedcc75111524fec4e928b3f inherit pub_methods_classThreadPoolExecutor"><td class="memTemplItemLeft" align="right" valign="top">std::future&lt; typename std::result_of&lt; F()&gt;::type &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a94834ab6bedcc75111524fec4e928b3f">submit</a> (F f, bool core=true)</td></tr>
<tr class="memdesc:a94834ab6bedcc75111524fec4e928b3f inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">submit 在将来某个时候执行给定的任务, 任务可以在新线程或现有的合并的线程中执行, 可以有返回值,向任务队列提交的是任务副本 会抛出异常  <a href="classThreadPoolExecutor.html#a94834ab6bedcc75111524fec4e928b3f">更多...</a><br /></td></tr>
<tr class="separator:a94834ab6bedcc75111524fec4e928b3f inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e340cec3bb976f7773db103d73189c2 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a8e340cec3bb976f7773db103d73189c2">toString</a> () const</td></tr>
<tr class="memdesc:a8e340cec3bb976f7773db103d73189c2 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">toString 返回标识此池的字符串及其状态，包括运行状态和估计的Worker和任务计数的指示  <a href="classThreadPoolExecutor.html#a8e340cec3bb976f7773db103d73189c2">更多...</a><br /></td></tr>
<tr class="separator:a8e340cec3bb976f7773db103d73189c2 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac9345329aa167200bec31951d2f5a690 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#ac9345329aa167200bec31951d2f5a690">getActiveCount</a> () const final</td></tr>
<tr class="memdesc:ac9345329aa167200bec31951d2f5a690 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">getActiveCount 返回正在执行任务的线程的大概数量  <a href="classThreadPoolExecutor.html#ac9345329aa167200bec31951d2f5a690">更多...</a><br /></td></tr>
<tr class="separator:ac9345329aa167200bec31951d2f5a690 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a396d50079b39787928ead5f122781de6 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a396d50079b39787928ead5f122781de6">getTaskCount</a> () const final</td></tr>
<tr class="memdesc:a396d50079b39787928ead5f122781de6 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">getTaskCount 得到任务队列大小  <a href="classThreadPoolExecutor.html#a396d50079b39787928ead5f122781de6">更多...</a><br /></td></tr>
<tr class="separator:a396d50079b39787928ead5f122781de6 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5a10d336958ca43530b31bff81c9c4b inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#ac5a10d336958ca43530b31bff81c9c4b">setMaxPoolSize</a> (int maxPoolSize) final</td></tr>
<tr class="memdesc:ac5a10d336958ca43530b31bff81c9c4b inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">setMaxPoolSize 设置允许的最大线程数。 这将覆盖在构造函数中设置的任何值。 如果新值小于当前值，则过多的现有线程在下一个空闲时将被终止  <a href="classThreadPoolExecutor.html#ac5a10d336958ca43530b31bff81c9c4b">更多...</a><br /></td></tr>
<tr class="separator:ac5a10d336958ca43530b31bff81c9c4b inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af630e5117b4f67428a4fcbee5c15a7d9 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#af630e5117b4f67428a4fcbee5c15a7d9">getEverPoolSize</a> () const final</td></tr>
<tr class="memdesc:af630e5117b4f67428a4fcbee5c15a7d9 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">getLargestPoolSize 返回池中使用过的线程数  <a href="classThreadPoolExecutor.html#af630e5117b4f67428a4fcbee5c15a7d9">更多...</a><br /></td></tr>
<tr class="separator:af630e5117b4f67428a4fcbee5c15a7d9 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ee7a201ac0a8c9bd246a83939e39194 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a1ee7a201ac0a8c9bd246a83939e39194">startCoreThreads</a> () final</td></tr>
<tr class="memdesc:a1ee7a201ac0a8c9bd246a83939e39194 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">startCoreThreads 启动所有核心线程，导致他们等待工作。 这将覆盖仅在执行新任务时启动核心线程的默认策略  <a href="classThreadPoolExecutor.html#a1ee7a201ac0a8c9bd246a83939e39194">更多...</a><br /></td></tr>
<tr class="separator:a1ee7a201ac0a8c9bd246a83939e39194 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af29377a50af53031bb06aeacf9ef27f7 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#af29377a50af53031bb06aeacf9ef27f7">getCorePoolSize</a> () const final</td></tr>
<tr class="memdesc:af29377a50af53031bb06aeacf9ef27f7 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">getCorePoolSize 返回核心线程数  <a href="classThreadPoolExecutor.html#af29377a50af53031bb06aeacf9ef27f7">更多...</a><br /></td></tr>
<tr class="separator:af29377a50af53031bb06aeacf9ef27f7 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa834c4350d6b12826803bb13dd467ea inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="aaa834c4350d6b12826803bb13dd467ea"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#aaa834c4350d6b12826803bb13dd467ea">shutdown</a> () final</td></tr>
<tr class="memdesc:aaa834c4350d6b12826803bb13dd467ea inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">shutdown 不在接受新任务,并且在所有任务执行完后终止线程池 <br /></td></tr>
<tr class="separator:aaa834c4350d6b12826803bb13dd467ea inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a588ec33baf402afd0e1c52b11d9234da inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a588ec33baf402afd0e1c52b11d9234da"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a588ec33baf402afd0e1c52b11d9234da">stop</a> () final</td></tr>
<tr class="memdesc:a588ec33baf402afd0e1c52b11d9234da inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">stop 不在接受新任务,终止旧任务,释放正在运行的线程 <br /></td></tr>
<tr class="separator:a588ec33baf402afd0e1c52b11d9234da inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac33c356670eabe5345992331e615348c inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#ac33c356670eabe5345992331e615348c">isShutDown</a> () final</td></tr>
<tr class="memdesc:ac33c356670eabe5345992331e615348c inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">isShutDown 判断线程池是否shutdown  <a href="classThreadPoolExecutor.html#ac33c356670eabe5345992331e615348c">更多...</a><br /></td></tr>
<tr class="separator:ac33c356670eabe5345992331e615348c inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89ed68d6c67ad6fbde73b7883c8107a7 inherit pub_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a89ed68d6c67ad6fbde73b7883c8107a7">isTerminated</a> () final</td></tr>
<tr class="memdesc:a89ed68d6c67ad6fbde73b7883c8107a7 inherit pub_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">isTerminated 判断线程池是否terminated  <a href="classThreadPoolExecutor.html#a89ed68d6c67ad6fbde73b7883c8107a7">更多...</a><br /></td></tr>
<tr class="separator:a89ed68d6c67ad6fbde73b7883c8107a7 inherit pub_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="inherited"></a>
额外继承的成员函数</h2></td></tr>
<tr class="inherit_header pro_methods_classThreadPoolExecutor"><td colspan="2" onclick="javascript:toggleInherit('pro_methods_classThreadPoolExecutor')"><img src="closed.png" alt="-"/>&#160;Protected 成员函数 继承自 <a class="el" href="classThreadPoolExecutor.html">ThreadPoolExecutor</a></td></tr>
<tr class="memitem:a61774315237123faf8e7fcc9d35ae47d inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a61774315237123faf8e7fcc9d35ae47d"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a61774315237123faf8e7fcc9d35ae47d">terminated</a> ()</td></tr>
<tr class="memdesc:a61774315237123faf8e7fcc9d35ae47d inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">terminated 线程池终止时执行 <br /></td></tr>
<tr class="separator:a61774315237123faf8e7fcc9d35ae47d inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acdb626fdcb6ed4c7822508d1e0a3fcf5 inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#acdb626fdcb6ed4c7822508d1e0a3fcf5">runStateOf</a> (int32_t c) const final</td></tr>
<tr class="memdesc:acdb626fdcb6ed4c7822508d1e0a3fcf5 inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">runStateOf 得到线程池状态  <a href="classThreadPoolExecutor.html#acdb626fdcb6ed4c7822508d1e0a3fcf5">更多...</a><br /></td></tr>
<tr class="separator:acdb626fdcb6ed4c7822508d1e0a3fcf5 inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f842d070a584bbc16a693207a947aac inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a4f842d070a584bbc16a693207a947aac">workerCountOf</a> (int32_t c) const final</td></tr>
<tr class="memdesc:a4f842d070a584bbc16a693207a947aac inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">workerCountOf 得到工作线程数量  <a href="classThreadPoolExecutor.html#a4f842d070a584bbc16a693207a947aac">更多...</a><br /></td></tr>
<tr class="separator:a4f842d070a584bbc16a693207a947aac inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31ed7a73571c79c8dbb486f27a4df4eb inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a31ed7a73571c79c8dbb486f27a4df4eb">ctlOf</a> (int32_t rs, int32_t wc) const final</td></tr>
<tr class="memdesc:a31ed7a73571c79c8dbb486f27a4df4eb inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">ctlOf 控制变量初始化  <a href="classThreadPoolExecutor.html#a31ed7a73571c79c8dbb486f27a4df4eb">更多...</a><br /></td></tr>
<tr class="separator:a31ed7a73571c79c8dbb486f27a4df4eb inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec8e7c250025db138cde555d759c8194 inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#aec8e7c250025db138cde555d759c8194">addWorker</a> (<a class="el" href="classRunnable.html">Runnable</a> task, bool core=true) final</td></tr>
<tr class="memdesc:aec8e7c250025db138cde555d759c8194 inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">addWorker 将任务添加到队列  <a href="classThreadPoolExecutor.html#aec8e7c250025db138cde555d759c8194">更多...</a><br /></td></tr>
<tr class="separator:aec8e7c250025db138cde555d759c8194 inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2615dd9c245049110104603289beb54 inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#ac2615dd9c245049110104603289beb54">addWorker</a> (Runnable::sptr task, bool core=true) final</td></tr>
<tr class="memdesc:ac2615dd9c245049110104603289beb54 inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">addWorker 将任务添加到队列  <a href="classThreadPoolExecutor.html#ac2615dd9c245049110104603289beb54">更多...</a><br /></td></tr>
<tr class="separator:ac2615dd9c245049110104603289beb54 inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abaa3926310766a93b7fe1d83b77efdae inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#abaa3926310766a93b7fe1d83b77efdae">advanceRunState</a> (int32_t targetState) final</td></tr>
<tr class="memdesc:abaa3926310766a93b7fe1d83b77efdae inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">advanceRunState 改变线程池状态  <a href="classThreadPoolExecutor.html#abaa3926310766a93b7fe1d83b77efdae">更多...</a><br /></td></tr>
<tr class="separator:abaa3926310766a93b7fe1d83b77efdae inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14c4e3d786dcf22e858b11a95d2f77ef inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a14c4e3d786dcf22e858b11a95d2f77ef">reject</a> (const <a class="el" href="classRunnable.html">Runnable</a> &amp;command) final</td></tr>
<tr class="memdesc:a14c4e3d786dcf22e858b11a95d2f77ef inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">reject 将任务抛弃  <a href="classThreadPoolExecutor.html#a14c4e3d786dcf22e858b11a95d2f77ef">更多...</a><br /></td></tr>
<tr class="separator:a14c4e3d786dcf22e858b11a95d2f77ef inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a353e65b77bb3c0950ed79939473d4852 inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a353e65b77bb3c0950ed79939473d4852">reject</a> (const Runnable::sptr command) final</td></tr>
<tr class="memdesc:a353e65b77bb3c0950ed79939473d4852 inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">reject 将任务抛弃  <a href="classThreadPoolExecutor.html#a353e65b77bb3c0950ed79939473d4852">更多...</a><br /></td></tr>
<tr class="separator:a353e65b77bb3c0950ed79939473d4852 inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa12a3efb879080453fb7abc486585698 inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#aa12a3efb879080453fb7abc486585698">runStateLessThan</a> (int c, int s) const final</td></tr>
<tr class="memdesc:aa12a3efb879080453fb7abc486585698 inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">runStateLessThan 状态低于  <a href="classThreadPoolExecutor.html#aa12a3efb879080453fb7abc486585698">更多...</a><br /></td></tr>
<tr class="separator:aa12a3efb879080453fb7abc486585698 inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44ee48ed44faa12fc6373074e9059e4e inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a44ee48ed44faa12fc6373074e9059e4e">runStateAtLeast</a> (int c, int s) const final</td></tr>
<tr class="memdesc:a44ee48ed44faa12fc6373074e9059e4e inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">runStateAtLeast 运行状态最少是  <a href="classThreadPoolExecutor.html#a44ee48ed44faa12fc6373074e9059e4e">更多...</a><br /></td></tr>
<tr class="separator:a44ee48ed44faa12fc6373074e9059e4e inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a841ae2189d6f85b9df9f69dec5375341 inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a841ae2189d6f85b9df9f69dec5375341">isRunning</a> (int c) const final</td></tr>
<tr class="memdesc:a841ae2189d6f85b9df9f69dec5375341 inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">isRunning 是否还在运行  <a href="classThreadPoolExecutor.html#a841ae2189d6f85b9df9f69dec5375341">更多...</a><br /></td></tr>
<tr class="separator:a841ae2189d6f85b9df9f69dec5375341 inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac1bcafe65f800aeb9feade5f31b64fde inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="ac1bcafe65f800aeb9feade5f31b64fde"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>compareAndIncrementWorkerCount</b> (int expect) final</td></tr>
<tr class="separator:ac1bcafe65f800aeb9feade5f31b64fde inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac40053b88cd669526a0a6225b5e1a86e inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="ac40053b88cd669526a0a6225b5e1a86e"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>compareAndDecrementWorkerCount</b> (int expect) final</td></tr>
<tr class="separator:ac40053b88cd669526a0a6225b5e1a86e inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab19dcfa8af5864274e66bccf40255484 inherit pro_methods_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="ab19dcfa8af5864274e66bccf40255484"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#ab19dcfa8af5864274e66bccf40255484">decrementWorkerCount</a> ()</td></tr>
<tr class="memdesc:ab19dcfa8af5864274e66bccf40255484 inherit pro_methods_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">decrementWorkerCount 减少ctl的workerCount字段 <br /></td></tr>
<tr class="separator:ab19dcfa8af5864274e66bccf40255484 inherit pro_methods_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_classThreadPoolExecutor"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_classThreadPoolExecutor')"><img src="closed.png" alt="-"/>&#160;Protected 属性 继承自 <a class="el" href="classThreadPoolExecutor.html">ThreadPoolExecutor</a></td></tr>
<tr class="memitem:af82bff422304406f59a14b5b638c2b42 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="af82bff422304406f59a14b5b638c2b42"></a>
const int32_t&#160;</td><td class="memItemRight" valign="bottom"><b>COUNT_BITS</b> = 29</td></tr>
<tr class="separator:af82bff422304406f59a14b5b638c2b42 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aac96b726327ad0d07709085ab49c4f58 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="aac96b726327ad0d07709085ab49c4f58"></a>
const int32_t&#160;</td><td class="memItemRight" valign="bottom"><b>CAPACITY</b> = (1 &lt;&lt; COUNT_BITS) - 1</td></tr>
<tr class="separator:aac96b726327ad0d07709085ab49c4f58 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e28d5aa0cb4500921f7244565b8bed8 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a9e28d5aa0cb4500921f7244565b8bed8"></a>
const int32_t&#160;</td><td class="memItemRight" valign="bottom"><b>RUNNING</b> = (-1 &lt;&lt; COUNT_BITS)</td></tr>
<tr class="separator:a9e28d5aa0cb4500921f7244565b8bed8 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0958f2bf040bf2f199c629ec9145b44 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="aa0958f2bf040bf2f199c629ec9145b44"></a>
const int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#aa0958f2bf040bf2f199c629ec9145b44">SHUTDOWN</a> = 0 &lt;&lt; COUNT_BITS</td></tr>
<tr class="memdesc:aa0958f2bf040bf2f199c629ec9145b44 inherit pro_attribs_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">运行状态 <br /></td></tr>
<tr class="separator:aa0958f2bf040bf2f199c629ec9145b44 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae3c0ff657b3c0d8bbaf7f10bfdf587ca inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="ae3c0ff657b3c0d8bbaf7f10bfdf587ca"></a>
const int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#ae3c0ff657b3c0d8bbaf7f10bfdf587ca">STOP</a> = 1 &lt;&lt; COUNT_BITS</td></tr>
<tr class="memdesc:ae3c0ff657b3c0d8bbaf7f10bfdf587ca inherit pro_attribs_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">不再接受新任务 <br /></td></tr>
<tr class="separator:ae3c0ff657b3c0d8bbaf7f10bfdf587ca inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d2a0964f6bce420433491da80000c4c inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a3d2a0964f6bce420433491da80000c4c"></a>
const int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a3d2a0964f6bce420433491da80000c4c">TIDYING</a> = 2 &lt;&lt; COUNT_BITS</td></tr>
<tr class="memdesc:a3d2a0964f6bce420433491da80000c4c inherit pro_attribs_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">不再接受新任务,队列中的任务将比抛弃 <br /></td></tr>
<tr class="separator:a3d2a0964f6bce420433491da80000c4c inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15bb29c714876435f3c59cd0137ac074 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a15bb29c714876435f3c59cd0137ac074"></a>
const int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#a15bb29c714876435f3c59cd0137ac074">TERMINATED</a> = 3 &lt;&lt; COUNT_BITS</td></tr>
<tr class="memdesc:a15bb29c714876435f3c59cd0137ac074 inherit pro_attribs_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">所有线程已经释放,任务队列为空,会调用terminated() <br /></td></tr>
<tr class="separator:a15bb29c714876435f3c59cd0137ac074 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4496adc7a7ff18b97464a863fcf4a73 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="ac4496adc7a7ff18b97464a863fcf4a73"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classThreadPoolExecutor.html#ac4496adc7a7ff18b97464a863fcf4a73">corePoolSize_</a></td></tr>
<tr class="memdesc:ac4496adc7a7ff18b97464a863fcf4a73 inherit pro_attribs_classThreadPoolExecutor"><td class="mdescLeft">&#160;</td><td class="mdescRight">线程池关闭,<a class="el" href="classThreadPoolExecutor.html#a61774315237123faf8e7fcc9d35ae47d" title="terminated 线程池终止时执行 ">terminated()</a>函数已经执行 <br /></td></tr>
<tr class="separator:ac4496adc7a7ff18b97464a863fcf4a73 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7fb9fd51e0a4b27277012c16596b9137 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a7fb9fd51e0a4b27277012c16596b9137"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>maxPoolSize_</b></td></tr>
<tr class="separator:a7fb9fd51e0a4b27277012c16596b9137 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34c5c9c9178c0d60c196e803afa641fe inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a34c5c9c9178c0d60c196e803afa641fe"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><b>submitId_</b> {0}</td></tr>
<tr class="separator:a34c5c9c9178c0d60c196e803afa641fe inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf28232c8314da96403992137fdd1c2f inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="acf28232c8314da96403992137fdd1c2f"></a>
std::string&#160;</td><td class="memItemRight" valign="bottom"><b>prefix_</b></td></tr>
<tr class="separator:acf28232c8314da96403992137fdd1c2f inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c8fc052c3760c89bf5198409d8c9c72 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a2c8fc052c3760c89bf5198409d8c9c72"></a>
volatile bool&#160;</td><td class="memItemRight" valign="bottom"><b>keepNonCoreThreadAlive_</b> {false}</td></tr>
<tr class="separator:a2c8fc052c3760c89bf5198409d8c9c72 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8f4e68f28d617749537036f6e688b8c inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="ad8f4e68f28d617749537036f6e688b8c"></a>
std::atomic&lt; int &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>everPoolSize_</b> {0}</td></tr>
<tr class="separator:ad8f4e68f28d617749537036f6e688b8c inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ef0eea2a8ca7a03bd9d361ced31f71b inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a2ef0eea2a8ca7a03bd9d361ced31f71b"></a>
std::mutex&#160;</td><td class="memItemRight" valign="bottom"><b>mutex_</b></td></tr>
<tr class="separator:a2ef0eea2a8ca7a03bd9d361ced31f71b inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af4f94013afa2ddf003b2f8ff7f7a8fad inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="af4f94013afa2ddf003b2f8ff7f7a8fad"></a>
std::mutex&#160;</td><td class="memItemRight" valign="bottom"><b>threadMutex_</b></td></tr>
<tr class="separator:af4f94013afa2ddf003b2f8ff7f7a8fad inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a010113b7aac17ef364d417c485263873 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a010113b7aac17ef364d417c485263873"></a>
std::atomic_int32_t&#160;</td><td class="memItemRight" valign="bottom"><b>ctl_</b></td></tr>
<tr class="separator:a010113b7aac17ef364d417c485263873 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad523af8548ca8f1dae80cb295ee567b3 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="ad523af8548ca8f1dae80cb295ee567b3"></a>
std::condition_variable&#160;</td><td class="memItemRight" valign="bottom"><b>notEmpty_</b></td></tr>
<tr class="separator:ad523af8548ca8f1dae80cb295ee567b3 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47dd74330fa41d01067943b1db74818a inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a47dd74330fa41d01067943b1db74818a"></a>
std::vector&lt; Thread::sptr &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>threads_</b></td></tr>
<tr class="separator:a47dd74330fa41d01067943b1db74818a inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a415491f8f40c0fcb99e7ec25cdd209d0 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a415491f8f40c0fcb99e7ec25cdd209d0"></a>
std::vector&lt; <a class="el" href="classBlockingQueue.html">BlockingQueue</a>&lt; Runnable::sptr &gt; &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>workQueues_</b></td></tr>
<tr class="separator:a415491f8f40c0fcb99e7ec25cdd209d0 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a347041db412b03aa09dd4e9b3beaa391 inherit pro_attribs_classThreadPoolExecutor"><td class="memItemLeft" align="right" valign="top"><a id="a347041db412b03aa09dd4e9b3beaa391"></a>
std::unique_ptr&lt; <a class="el" href="classRejectedExecutionHandler.html">RejectedExecutionHandler</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>rejectHandler_</b></td></tr>
<tr class="separator:a347041db412b03aa09dd4e9b3beaa391 inherit pro_attribs_classThreadPoolExecutor"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>任务窃取线程池,从下一个线程的任务队列窃取任务 </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="ae0445ee114ceec03cf9513c394df7c89"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae0445ee114ceec03cf9513c394df7c89">&#9670;&nbsp;</a></span>coreWorkerThread()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void WorkStealingPoolExecutor::coreWorkerThread </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>queueIdex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>workerThread 非核心工作线程 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">queueIdex</td><td>线程队列位置 </td></tr>
  </table>
  </dd>
</dl>

<p>重载 <a class="el" href="classThreadPoolExecutor.html#a5e40839bf4191b5eab9d81227ddb62c3">ThreadPoolExecutor</a> .</p>

</div>
</div>
<a id="a84571339d5bafe81925c10d27f020ab4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a84571339d5bafe81925c10d27f020ab4">&#9670;&nbsp;</a></span>submit()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename F &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">std::future&lt;typename std::result_of&lt;F()&gt;::type&gt; WorkStealingPoolExecutor::submit </td>
          <td>(</td>
          <td class="paramtype">F&#160;</td>
          <td class="paramname"><em>f</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>core</em> = <code>true</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>submit 在将来某个时候执行给定的任务, 任务可以在新线程或现有的合并的线程中执行, 可以有返回值,向任务队列提交的是任务副本 会抛出异常 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">f</td><td>要提交的任务(Runnable或函数或lambda) </td></tr>
    <tr><td class="paramname">core</td><td>是否使用核心线程(默认值true,不增加新线程)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>res 任务返回值的future </dd></dl>

</div>
</div>
<a id="ad00399d153ba5d77704dae2c1816b566"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad00399d153ba5d77704dae2c1816b566">&#9670;&nbsp;</a></span>workerThread()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void WorkStealingPoolExecutor::workerThread </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>queueIdex</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">override</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>workerThread 核心工作线程 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">queueIdex</td><td>线程队列位置 </td></tr>
  </table>
  </dd>
</dl>

<p>重载 <a class="el" href="classThreadPoolExecutor.html#a844902ce61fb16b11a569b8ee56e80e9">ThreadPoolExecutor</a> .</p>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li><a class="el" href="workstealingpoolexecutor_8hpp_source.html">workstealingpoolexecutor.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
